<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <div class="mypic"> onload.....</div>
  <script>
    var obj = new Image()

    obj.src =
      "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2771978851,2906984932&fm=26&gp=0.jpg"
    obj.onload = function () {

      alert("图片的宽度是" + obj.width + "图片的宽度是" + obj.height)
      Document.getElementById("mypic").innerHTML = "<img src=" + this.src + "/>"
    }
  </script>
</body>

</html>